<template>
	<div style="height: 100%;">
		<div class="fixed head" v-if="this.routerName!='RingPoster'">
			<top @editPwd="editPwd"></top>
			<my-nav></my-nav>
		</div>
		<new-top v-else></new-top>
		<router-view ref="page" class="page-wrap"></router-view>
		<edit-password ref="editPassword" :show="editPwdVisible" @closeEditPwd="closeEditPwd"></edit-password>
	</div>
</template>

<script>
	
	import Top from '@/components/Top'
	import NewTop from '@/components/NewTop'
	import MyNav from '@/components/Nav'
	import EditPassword from '@/components/EditPassword'
	import { getURLQueryString, getCookie, setCookie } from '@/utils/common'
	import * as routes from '@/router/modules'

	export default {
		name: 'index',
		components: {
			Top,
			NewTop,
			MyNav,
			EditPassword,
		},
		data() {
			return {
				routerName: '',
				scale: 1,
				routeList: [],
				show: false, //是否显示首页导航
				editPwdVisible: false,
			}
		},
		computed: {
			user: function() {
				return this.$store.state.user
			}
		},
		async mounted() {
			var userInfo = await this.$request.queryAccountInfo()
			this.$store.commit('setUser', userInfo)
			var producttype = sessionStorage.getItem('producttype')
			this.$store.commit('setProductType', producttype)
			//			this.resize()
			//			window.onresize = this.resize
		},
		watch: {
			$route: {
				immediate: true,
				handler(routes) {
					this.routerName = routes.name
					// this.curTagName=routes.name;
				},
			}
		},
		methods: {
			resize() {
				var width = document.documentElement.clientWidth || document.body.clientWidth
				this.scale = width / 1920 * (width < 1600 ? 1.1 : 1)
				setCookie('scale', this.scale)
			},
			editPwd() {
				this.editPwdVisible = true
			},
			closeEditPwd() {
				this.editPwdVisible = false
			},
		}
	}
</script>

<style scoped lang="scss">
	.head {
		width: 100%;
	}
	
	.page-wrap {
		padding-top: 88px;
		height: 100%;
	}
	
	.icon-gonggao {
		color: rgb(243, 152, 0);
		font-size: 20px;
	}
	
	.el-icon-caret-top,
	.el-icon-caret-bottom {
		font-size: 16px;
	}
	
	.newslist .titbox {
		line-height: 21px;
	}
	
	.newslist .titbox .tt {
		font-size: 16px;
		color: #555;
		margin-left: 5px;
		font-weight: bold;
	}
	
	.newslist .titbox .acpic1 {
		margin-left: 16px;
		width: 40px;
		height: 20px;
	}
	
	.newslist .titbox {
		display: flex;
		justify-content: space-between;
	}
	
	.new-flag {
		width: 40px;
		height: 20px;
		text-align: center;
		color: #fff;
		font-size: 10px;
		border-radius: 4px;
		background: rgb(241, 80, 37);
		margin-left: 12px;
		vertical-align: middle;
	}
	
	.newslist .righ .date {
		font-size: 12px;
		color: #999;
	}
	
	.newslist li {
		padding: 12px;
		box-sizing: border-box;
		border-bottom: 1px solid #E0E0E0;
	}
	
	.newslist li:last-child {
		border: none;
	}
	
	.newslist .ccont {
		display: flex;
		padding-left: 32px;
		box-sizing: border-box;
		justify-content: space-between;
		margin-top: 7px;
		position: relative;
	}
	
	.newslist .ccont .lef {
		width: 530px;
		font-size: 14px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		color: #555;
	}
	
	.newslist .ccont .righ {
		position: relative;
	}
	
	.newslist .ccont .sport {
		margin-top: 7px;
		cursor: pointer;
		position: absolute;
		right: -7px;
		bottom: 4px;
		width: 50px;
		color: #999;
		font-size: 12px;
	}
	
	.notice-content {
		height: 24px;
		>>>* {
			line-height: 24px;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
		}
	}
	
	.open {
		height: auto;
		>>>* {
			line-height: 24px;
			white-space: normal;
		}
	}
</style>